package book;

/**
 * Created by cc
 * Description:
 * User: CZH
 * Date: 2022-09-23
 * Time: 19:17
 */
public class BookList {
    private int usedSize;
    private Book[] books = new Book[10];

    public BookList(){
        this.books[0] = new Book("三国演义","罗贯中",19,"小说");
        this.books[1] = new Book("西游记","吴承恩",29,"小说");
        this.books[2] = new Book("红楼梦","曹雪芹",39,"小说");
        this.books[3] = new Book("水浒传","施耐庵",49,"小说");
        usedSize += 4;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    //返回链表中存储图书数据的第 i 条.
    public Book getPos(int i){
        return books[i];
    }

    //在 pos 位置，设置图书 book 信息
    public void setBooks(int pos, Book book){
        books[pos] = book;
    }
}
